Completed
Push — master ( f48291...a65f2c )
by greg
74:59
created

ibutes.getAll()ꞌ)   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
c 0
b 0
f 0
nc 1
dl 0
loc 5
rs 9.4285
nop 1
1
var chai = require('chai');
2
3
var config = require('../src/cli').config
4
config.set({root: __dirname + '/fixtures'})
0 ignored issues
show
Compatibility introduced by
Consider using the path module for constructing paths since they are otherwise not cross-OS compatible.
Loading history...
5
6
var cmsData = require('../src/cli').cmsData;
7
var Manager = require('../src/cli').Manager;
8
var fse = require('fs-extra');
9
10
describe('attributes', function() {
11
  before( function(done) {
12
    Manager.instance.init()
13
      .then(function () {
14
        Manager.instance._whereKeys = ['title', 'priority', 'abe_meta', 'articles']
15
        Manager.instance.updateList()
16
17
        this.fixture = {
18
          tag: fse.readFileSync(__dirname + '/fixtures/templates/article.html', 'utf8'),
0 ignored issues
show
Compatibility introduced by
Consider using the path module for constructing paths since they are otherwise not cross-OS compatible.
Loading history...
19
          html: fse.readFileSync(__dirname + '/fixtures/templates/article.html', 'utf8'),
0 ignored issues
show
Compatibility introduced by
Consider using the path module for constructing paths since they are otherwise not cross-OS compatible.
Loading history...
20
          json: fse.readJsonSync(__dirname + '/fixtures/data/article-1.json')
0 ignored issues
show
Compatibility introduced by
Consider using the path module for constructing paths since they are otherwise not cross-OS compatible.
Loading history...
21
        }
22
        done()
23
        
24
      }.bind(this))
25
  });
26
27
  /**
28
   * cmsData.values.removeDuplicate
29
   * 
30
   */
31
  it('cmsData.values.removeDuplicate', function() {
32
    var newJson = cmsData.values.removeDuplicate(this.fixture.html, this.fixture.json)
33
    chai.expect(newJson.title).to.be.undefined;
0 ignored issues
show
introduced by
The result of the property access to chai.expect(newJson.title).to.be.undefined is not used.
Loading history...
34
  });
35
36
  /**
37
   * cmsData.attributes.sanitizeSourceAttribute
38
   * 
39
   */
40
  it('cmsData.attributes.sanitizeSourceAttribute', function() {
41
  	// not sure what it does
42
  });
43
44
  /**
45
   * cmsData.attributes.getAll
46
   * 
47
   */
48
  it('cmsData.attributes.getAll()', function(done) {
49
    var attributes = cmsData.attributes.getAll(this.fixture.tag, this.fixture.jsonArticle)
50
    chai.expect(attributes.sourceString).to.contain('select');
51
    done();
52
  });
53
});
54